package com.aiks.single.singlemavenproject.common.exception;

import lombok.Data;

/**
 * base exception.
 *
 * @author <a href="mailto:aiks_yuan@163.com">yuanzhen</a>
 * @date 2019-07-11 14:57
 * @since
 **/
@Data
public class BaseException extends RuntimeException {
    
    private final String errorKey;
    
    private final Object[] values;
    
    /**
     * construct.
     *
     * @param errorKey key
     * @param values values
     */
    public BaseException(final String errorKey, final Object... values) {
        super(errorKey);
        this.errorKey = errorKey;
        this.values = values;
    }
    
    /**
     * throwable cause.
     *
     * @param cause throwable
     * @param errorKey key
     * @param values values
     */
    public BaseException(final Throwable cause, final String errorKey, final Object... values) {
        super(cause);
        this.errorKey = errorKey;
        this.values = values;
    }
}
